import type { IPage } from '@/api/interface'
import type { IMetaTag } from '@/api/interface/system/meta/metaTag'
import { SYSTEM_MODULE } from '@/api/helper/prefix'
import { http } from '@/utils/http'

/**
 * 查询列表
 * @param params
 * @returns {*}
 */
export function getMetaTagListApi(params: IMetaTag.Query) {
  return http.get<IPage<IMetaTag.Row>>(`${SYSTEM_MODULE}/meta-tag/list`, params)
}

/**
 * 获取分类标签数量
 * @returns {*}
 */
export function getMetaTagCategoryCountApi() {
  return http.get<IMetaTag.CategoryCount[]>(`${SYSTEM_MODULE}/meta-tag/categoryCount`)
}

/**
 * 添加
 * @param params
 * @returns {*}
 */
export function createMetaTagApi(params: IMetaTag.Form) {
  return http.post(`${SYSTEM_MODULE}/meta-tag/create`, params)
}

/**
 * 修改
 * @param params
 * @returns {*}
 */
export function updateMetaTagApi(params: IMetaTag.Form) {
  return http.put(`${SYSTEM_MODULE}/meta-tag/update`, params)
}

/**
 * 删除
 * @param params
 * @returns {*}
 */
export function removeMetaTagApi(params: { ids: (string | number)[] }) {
  return http.delete(`${SYSTEM_MODULE}/meta-tag/remove`, params)
}

/**
 * 获取详情
 * @param params
 * @returns {*}
 */
export function getMetaTagDetailApi(params: { id: number }) {
  return http.get<IMetaTag.Row>(`${SYSTEM_MODULE}/meta-tag/detail`, params)
}
